HTMLify

style.css
Views: 26 | Author: cody
@import url("https://fonts.googleapis.com/css2?family=Basic&family=Poppins&display=swap");

:root {
  --background: #151515;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Poppins;
  height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  background-color: var(--background);
}

.gallery {
  display: flex;
  background-color: var(--background);
  gap: 16px;
  scale: 1.6;
}

.card {
  position: relative;
  left: 0;
  width: 140px;
  height: 160px;
  background-color: var(--background);
  border-radius: 8px;
  transition: 1000ms all;
  transform-origin: center left;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.54);
  overflow: hidden;
}

.card img {
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
}

.card:hover {
  cursor: pointer;
  transform: scale(1.15);
}

.card:hover figcaption {
  font-size: 0.6rem;
  position: absolute;
  height: 80px;
  width: 160px;
  display: flex;
  align-items: end;
  background: linear-gradient(to top,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0) 100%);
  color: #fff;
  left: 0;
  bottom: 0;
  padding-left: 12px;
  padding-bottom: 10px;
}

.card:hover~.card {
  font-weight: bold;
  cursor: pointer;
  transform: translateX(22px);
}

Comments